var DialogComponent = React.createClass({
	componentDidMount: function() {

	},
	receiveMsg: function(data) {

	},
    getInitialState: function () {
        this.props.isHidden = true;
        return this.props ? this.props : {};
    },
    confirm: function() {
        this.setState({
            isHidden: true
        });
        if(this.state.data.success) {
            this.state.data.success();
        }
    },
    show: function() {
        this.setState({
            isHidden: false
        });
        return this;
    },
    IKonw: function() {
        this.setState({
            isHidden: true
        });
        return this;
    },
    render:function() {
        var data = this.state.data;
        if(!data.title) {
            data.title = "";
        }

        return ~dialog;
    }
});
DialogComponent.init = function(config) {
    if($("#prompt").length > 0) {
        $("#prompt").remove();
    }
    var divEle = $("<div id='prompt'>");
    var dialog = ReactDOM.render(<DialogComponent data={config} />, divEle[0]);
    $("body").append(divEle);
    return dialog;
}
module.exports = DialogComponent;